<!-- 防止学生用户未登录就使用 -->
<?php
session_start();
if (!isset($_SESSION["role"])||($_SESSION["role"]!="student"))
    header("location:../index.php");
?>

<html>
<head>
<meta http-equiv="Content-Type"content="text/html; charset=UTF-8" />
<title>社团列表</title>
</head>
<body>
<?php //echo "<center><br /><a href='showsession.php'>返回功能列表</a></center>"; ?>
<center>社团列表</center>
<table width="660" border="1" align="center" cellpadding="0" cellspacing="1">
    <tr bgcolor="#0066CC"> 
      <td width="80" align="center"><font color="#FFFFFF"><b>操作</b></font></td>
      <td width="220" align="center"><font color="#FFFFFF"><b>社团名称</b></font></td>
      <td width="120" align="center"><font color="#FFFFFF"><b>类别</b></font></td>
      <td width="80" align="center"><font color="#FFFFFF"><b>级别</b></font></td>
      <td width="80" align="center"><font color="#FFFFFF"><b>志愿状态</b></font></td>
        <td width="80" align="center"><font color="#FFFFFF"><b>志愿号</b></font></td>
    </tr>
<!-- 查询数据库中，学生已选社团志愿信息 -->
<?php
include("../functions/db_conn.php");
//session_start();
//$stuno='17010001';
$stuno=$_SESSION["username"];
$ShowSoci_sql = "SELECT * FROM stusoci sc, soci s where sc.socino=s.socino and stuno='$stuno'";
$ShowSociResult = mysql_query($ShowSoci_sql);

$number = mysql_num_rows($ShowSociResult);
if ($number>0) { 
   for ($i = 0; $i < $number; $i++) {
       $row = mysql_fetch_array($ShowSociResult);
       if ($i%2 == 0) 
           echo "<tr bgcolor='#DDDDDD'  align='center'>";
       else
           echo "<tr align='center'>";
       echo "<td width='80'><a href='unselectsoci.php?will=".$row['WillOrder']."'>取消</a></td>";
       echo "<td width='80'>".$row['SociNo']."</td>";
       echo "<td width='220'>".$row['SociName']."</td>";
       echo "<td width='120'>".$row['Kind']."</td>";
       echo "<td width='80'>".$row['State']."</td>";
       echo "<td width='80'>".$row['WillOrder']."</td>";
       echo "</tr>";
    }
} 
?>
</table>
<br>
</center>
</body>
</html>
